

import 'package:bt_tool/basic/bt_router.dart';
import 'package:bt_tool/basic/bt_router_define.dart';
import 'package:bt_tool/debug/bt_debug_api_det_page.dart';
import 'package:bt_tool/debug/bt_debug_log_file_pick_page.dart';
import 'package:bt_tool/debug/bt_debug_page.dart';
import 'package:bt_tool/demo/demo.dart';
import 'package:flutter/material.dart';
import 'package:flutter_demo/tools/copy/copy_past_main_page.dart';
import 'package:flutter_demo/tools/credit/credit_main_page.dart';
import 'package:flutter_demo/tools/donext/page/do_next_create_page.dart';
import 'package:flutter_demo/tools/encode/encode_main_page.dart';
import 'package:flutter_demo/tools/encrypt/encrypt_main_page.dart';
import 'package:flutter_demo/tools/imgPath/page/img_path_main_page.dart';
import 'package:flutter_demo/tools/imgPath/page/img_path_pick_folder_page.dart';
import 'package:flutter_demo/tools/json/json_main_page.dart';
import 'package:flutter_demo/tools/jsonPreview/json_preview_main_page.dart';
import 'package:flutter_demo/tools/project/page/project_man_page.dart';
import 'package:flutter_demo/tools/tools_main_page.dart';
import 'package:flutter_demo/tools/translate/page/translate_config_page.dart';
import 'package:flutter_demo/tools/translate/page/translate_result_page.dart';

import '../../tools/donext/page/do_next_main_page.dart';
import '../../tools/translate/page/translate_main_page.dart';


class AppRouterDefine {

  static const encodeMainPage = "${BTRouter.btRouterStart}encode/main";//encode页面
  static const jsonMainPage = "${BTRouter.btRouterStart}json/main";//json页面
  static const encryptMainPage = "${BTRouter.btRouterStart}encrypt/main";//encrypt加密主页
  static const doNextMainPage = "${BTRouter.btRouterStart}doNext/main";//doNext主页
  static const creditMainPage = "${BTRouter.btRouterStart}credit/main";//credit主页
  static const copyPastMainPage = "${BTRouter.btRouterStart}copyPast/main";//copyPast主页
  static const imgPathMainPage = "${BTRouter.btRouterStart}imgPath/main";//生成flutter img path主页
  static const imgPathPickFolderPage = "${BTRouter.btRouterStart}imgPath/pickFolder";
  static const projectMainPage = "${BTRouter.btRouterStart}project/main";//项目主页
  static const projectSelectPage = "${BTRouter.btRouterStart}project/select";//选择项目
  static const translateMainPage = "${BTRouter.btRouterStart}translate/main";//翻译主页面
  static const translateConfigPage = "${BTRouter.btRouterStart}translate/config";//翻译主页面
  static const doNextCreatePage = "${BTRouter.btRouterStart}doNext/create"; //doNext主页 创建界面
  static const translateResultPage = "${BTRouter.btRouterStart}translate/result"; //翻译结果界面
  static const jsonPreviewMainPage = "${BTRouter.btRouterStart}jsonPreview/main"; //json预览主界面

}



class AppRouterLogic with BTRouterProtocol{



  bool isNeedLoginToUseApp(){
    return false;
  }

  @override
  Widget? getWidgetWithRouter(BTRouterConfig? routerConfig) {
    if(routerConfig == null){
      return null;
    }

    String routerName = routerConfig.routerName ?? "";
    if(routerName.isEmpty){
      return null;
    }

    if(routerName == BTRouterDefine.btMainTabbarPageRouterName){
      return ToolsMainPage(routerConfig: routerConfig,);
    }else if(routerName == BTRouterDefine.btDemoPageRouterName){
      return TestHomePage();
    }else if(routerName == BTRouterDefine.btDebugApiDetPageRouterName){
      return BTDebugApiDetPage(routerConfig: routerConfig,);
    }else if(routerName == BTRouterDefine.btDebugMainPageRouterName){
      return BTDebugPage(routerConfig: routerConfig,);
    }else if(routerName == BTRouterDefine.btDebugLogFilePickRouterName){
      return BTDebugLogFilePickPage(routerConfig:routerConfig);
    }else if(routerName == AppRouterDefine.encodeMainPage){
      return EncodeMainPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.jsonMainPage){
      return JsonMainPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.encryptMainPage){
      return EncryptMainPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.doNextMainPage){
      return DoNextMainPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.creditMainPage){
      return CreditMainPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.copyPastMainPage){
      return CopyPastMainPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.imgPathMainPage){
      return ImgPathMainPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.imgPathPickFolderPage){
      return ImgPathPickFolderPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.doNextCreatePage){
      return DoNextCreatePage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.projectMainPage){
      return ProjectMainPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.projectSelectPage){
      return ProjectMainPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.translateMainPage){
      return TranslateMainPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.translateConfigPage){
      return TranslateConfigPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.translateResultPage){
      return TranslateResultPage(routerConfig: routerConfig,);
    }else if(routerName == AppRouterDefine.jsonPreviewMainPage){
      return JsonPreviewMainPage(routerConfig: routerConfig,);
    }



    //业务逻辑类


    return null;
  }

  @override
  List<String> getTabPageRouterNameList() {
    return [
      AppRouterDefine.encodeMainPage,
      AppRouterDefine.jsonMainPage,
      AppRouterDefine.encryptMainPage,
      AppRouterDefine.doNextMainPage,
      AppRouterDefine.creditMainPage,
      AppRouterDefine.copyPastMainPage,
      AppRouterDefine.imgPathMainPage,
      AppRouterDefine.projectMainPage,
      AppRouterDefine.jsonPreviewMainPage,
      // AppRouterDefine.translateMainPage,
    ];
  }

  @override
  Widget? getWebPage(BTRouterConfig routerController) {
    return null;
  }



}

